package net.gaox.entrty;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * <p> 银行卡基础信息 </p>
 *
 * @author gaox·Eric
 * @date 2021/11/11 19:58
 */
public class BankAccount {

    /**
     * 银行卡列表
     */
    public static List<BankAccount> list = new ArrayList<>(16);

    /**
     * id
     */
    private Long id;

    /**
     * 银行卡号
     */
    private String accountNumber;

    /**
     * 姓名
     */
    private String name;

    /**
     * 余额
     */
    private BigDecimal balance;

    /**
     * 币种
     */
    private String currency;
    /**
     * 银行卡状态：正常、注销
     */
    private Boolean status;
    /**
     * 申请时间
     */
    private LocalDateTime applicationTime;

    /**
     * 注销时间
     */
    private LocalDateTime disableTime;

    /**
     * 有参构造器=申请方法
     *
     * @param id            id
     * @param accountNumber 银行卡号
     * @param name          姓名
     */
    public BankAccount(Long id, String accountNumber, String name) {
        this.id = id;
        this.accountNumber = accountNumber;
        this.name = name;
        this.balance = BigDecimal.ZERO;
        this.currency = "CNY";
        this.applicationTime = LocalDateTime.now();
        this.status = true;
        list.add(this);
    }

    public Long getId() {
        return id;
    }

    public String getAccountNumber() {
        return accountNumber;
    }

    public String getName() {
        return name;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public String getCurrency() {
        return currency;
    }

    public Boolean getStatus() {
        return status;
    }

    public LocalDateTime getApplicationTime() {
        return applicationTime;
    }

    public LocalDateTime getDisableTime() {
        return disableTime;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public void setDisableTime(LocalDateTime disableTime) {
        this.disableTime = disableTime;
    }

    @Override
    public String toString() {
        return "BankAccount{" +
                "id=" + id +
                ", accountNumber='" + accountNumber + '\'' +
                ", name='" + name + '\'' +
                ", balance=" + balance +
                ", currency='" + currency + '\'' +
                ", status=" + status +
                ", applicationTime=" + applicationTime +
                ", disableTime=" + disableTime +
                '}';
    }
}
